<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        html{
            background-color: pink;
        }

        .tabs {
            width: 300px;
            margin: 20px auto;
            outline: 1px solid pink;
        }

        .titles {
            display: flex;
            justify-content: space-between;

            background-color: rgb(197, 89, 103);
        }

        .titles .title {
            width: 33.3%;
            text-align: center;
            letter-spacing: 15px;
            height: 42px;
            line-height: 42px;
            margin-bottom: -1px;
            cursor: pointer;
        }

        .titles .title.active {
            background-color: rgb(143, 33, 57);
            color: #fff;
        }

        .lists {
            /* border: 1px solid #ccc; */
            border-top: none;
            color: rgb(146, 40, 66);
            background-color: pink;
        }

        .lists .list {
            width: 300px;
            height: 260px;
            display: none;
            /* min-height: 200px; */
        }

        .lists .list.active {
            display: block;
        }

    </style>
</head>

<body>
    <div id="app">
        <div class="tabs">
            <div class="titles">
                <div v-for="(t,i) in tabs.titles" :key="i" :class="{title: true, active:i==index}" @click="myclick(i)">
                    {{t}}</div>
            </div>
            <div class="lists">
                <div v-for="(l,i) in tabs.lists" :key="i" :class="{list: true, active:i==index}" :style="l.bg">
                    <img :src="l.pic" alt="" :style="l.hw">
                    {{l.text}}</div>
                    <img src="./img/" alt="">
            </div>
        </div>
    </div>
    <script src="./js/vue.min.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                index: 0,
                tabs: {
                    titles: ['麋鹿', '寓意', '麋路'],
                    lists: [
                        { pic: './img/麋路.jpg', text: '', hw: 'width: 300px; height: 260px;' },
                        { pic: '', text: '____麋鹿寓意着生命力旺盛，同时也寓意着富贵吉祥，有着和谐的象征。麋鹿是吉祥之物。鹿又被称为财鹿，不管是在东方还是西方都具有很好的寓意。麋鹿就代表了富贵、祥和，象征对美好未来的追求和向往。', bg: 'background-image: url(./img/麋鹿.jpg);background-repeat: no-repeat;background-size:300px 260px;', hw: 'width: 0px; height: 0px;' },
                        { pic: './img/迷鹿.jpg', text: '', hw: 'width: 300px; height: 260px;' },
                    ]
                }
            },
            methods: {
                myclick(index) {
                    this.index = index;
                    console.log(index);
                }
            }
        })
    </script>
</body>

</html>